﻿<%@ Assembly Name="DVK.SP2007, Version=1.0.3.0, Culture=neutral, PublicKeyToken=4a0962a1b6913d20" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MapMetadata.aspx.cs" Inherits="DVK.SP2007.Pages.MapMetadata"
    MasterPageFile="~/_layouts/simple.master" EnableSessionState="True" %>
<%@ Register TagPrefix="Sharepoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="wssuc" TagName="ButtonSection" Src="~/_controltemplates/ButtonSection.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormSection" Src="~/_controltemplates/InputFormSection.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormControl" Src="~/_controltemplates/InputFormControl.ascx" %>
<%@ Register TagPrefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI.WebControls" TagPrefix="asp" %>
<%-- Browseri Title Bar --%>
<asp:Content ID="Content6" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    <Sharepoint:EncodedLiteral ID="lblPageTitle" runat="server" 
        Text="<%$Resources:DvkWeb,MapMetadata_lblPageTitle%>"
        EncodeMethod='HtmlEncode' />
</asp:Content>
<%-- Lehe pealkiri --%>
<asp:Content ID="Content8" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea"
    runat="server">
    <Sharepoint:EncodedLiteral ID="lblPageTitleInTitleArea" runat="server" 
    Text="<%$Resources:DvkWeb,MapMetadata_lblPageTitleInTitleArea%>"
        EncodeMethod='HtmlEncode' />
</asp:Content>
<asp:Content ID="MainContent" runat="server" ContentPlaceHolderID="PlaceHolderMain">
    <%--Main table start--%>
    <table cellspacing="0" cellpadding="0" border="0" style="width: 100%; height: 100%"
        class="ms-settingsframe">
        <%--Error label--%>
        <tr>
            <td class="ms-error" colspan="2">
                <asp:Label ID="lbErrorMessage" runat="server" EnableViewState="False" />
            </td>
        </tr>
        <%--Header part--%>
        <tr>
            <td width="100%" colspan="2" style="padding-top: 0px;">
                <table class="ms-pageinformation" width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td valign="top" style="padding: 10px;" width="100%">
                            <table width="100%" id="idItemHoverTable">
                                <tr>
                                    <th scope="col" colspan="2" style="padding-bottom: 4px;" valign="top">
                                        <h3 class="ms-standardheader">
                                            <span class="ms-linksectionheader">
                                                <Sharepoint:EncodedLiteral ID="lblPageHeader" runat="server" Text="<%$Resources:DvkWeb,MapMetadata_lblPageHeader%>"
                                                    EncodeMethod='HtmlEncode' />
                                            </span>
                                        </h3>
                                    </th>
                                </tr>
                                <tr>
                                    <th scope="row" nowrap="nowrap" valign="top" id="500">
                                        <Sharepoint:EncodedLiteral ID="lblExistingConfigurations" runat="server" Text="<%$Resources:DvkWeb,MapMetadata_lblExistingConfigurations%>"
                                            EncodeMethod='HtmlEncode' />
                                    </th>
                                    <td width="90%" valign="top">
                                        <%-- Select Existing configurations --%>
                                        <asp:DropDownList ID="ddlExistingConfigurations" runat="server" AutoPostBack="true"
                                            CausesValidation="false" CssClass="ms-input" OnSelectedIndexChanged="ddlExistingConfigurations_SelectedIndexChanged" />
                                        <asp:Button ID="btnDeleteConfiguration" runat="server" CausesValidation="false" Text="<%$Resources:DvkWeb,MapMetadata_btnDeleteConfiguration%>"
                                            OnClick="btnDeleteConfiguration_Click" CssClass="ms-ButtonHeightWidth" ToolTip="<%$Resources:DvkWeb,MapMetadata_btnDeleteConfigurationToolTip%>" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <%--Main content --%>
        <%-- Edit/New configurations form --%>
        <wssuc:InputFormSection runat="server" Title="<%$Resources:DvkWeb,MapMetadata_ifsConfigFormTitle%>" Description="<%$Resources:DvkWeb,MapMetadata_ifsConfigFormDesc%>">
            <template_inputformcontrols>
            <%--Pealkiri, Tase, Identifikaator, Seosed--%>
            <wssuc:InputFormControl runat="server" LabelText="<%$Resources:DvkWeb,MapMetadata_ConfigTitle%>">
			    <Template_Control>
					    <wssawc:InputFormTextBox ValidationGroup="SaveConfigurationValidationGroup" Title="<%$Resources:DvkWeb,MapMetadata_ConfigTitle%>" class="ms-input" ID="txtConfigurationTitle" Columns="75" Runat="server" maxlength="255" />
					    <asp:RequiredFieldValidator ID="rfvTitleMustBeFilled" runat="server" Display="Dynamic" 
					    ControlToValidate="txtConfigurationTitle" ErrorMessage="*" ValidationGroup="SaveConfigurationValidationGroup" />
			    </Template_Control>
		    </wssuc:InputFormControl>
            <wssuc:InputFormControl runat="server" LabelText="<%$Resources:DvkWeb,MapMetadata_ConfigMappingLevel%>">
			    <Template_Control>
			    <asp:DropDownList ID="ddlMappingLevel" runat="server" AutoPostBack="true" 
			        CssClass="ms-input" OnSelectedIndexChanged="ddlMappingLevel_SelectedIndexChanged" Enabled="false" />
			    </Template_Control>
			</wssuc:InputFormControl>

            <wssuc:InputFormControl ID="inIdentifiers" runat="server" LabelText="<%$Resources:DvkWeb,MapMetadata_ConfigIdentifier%>">
			    <Template_Control>
			    <asp:DropDownList ID="ddlIdentifiers" runat="server" CssClass="ms-input" Enabled="false" />
			    </Template_Control>
			</wssuc:InputFormControl>

            <wssuc:InputFormControl ID="inMappingApplyingTo" runat="server" LabelText="<%$Resources:DvkWeb,MapMetadata_ConfigAppliesTo%>">
			    <Template_Control>
			    <asp:DropDownList ID="ddlMappingApplyingTo" runat="server" CssClass="ms-input" ToolTip="<%$Resources:DvkWeb,MapMetadata_ConfigAppliesToToolTip%>" />
			    </Template_Control>
			</wssuc:InputFormControl>
			
			<%--Fields mapping list--%>	

        <wssuc:InputFormControl ID="InputFormControl2" runat="server" LabelText="<%$Resources:DvkWeb,MapMetadata_ConfigCurrentMappingsList%>">
            <Template_Control>	

			<asp:ListView ID="listMappings" runat="server">
                            <LayoutTemplate>
			                <table>
				                <tr>
					                <td>
						                <table border="1" style="border-collapse:collapse;" ID="itemPlaceholderContainer" runat="server">
							                <tr id="Tr2" class="ms-unselectedtitle" style="background-color:Menu" runat="server">
								                <th id="Th1" runat="server" class="ms-vh2-nofilter"><asp:Label runat="server" ID="lblMappingsListSPField" Text="<%$Resources:DvkWeb,MapMetadata_lblMappingsListSPField%>" /> </th>
								                <th id="Th2" runat="server" class="ms-vh2-nofilter"><asp:Label runat="server" ID="lblMappingsListDVKField" Text="<%$Resources:DvkWeb,MapMetadata_lblMappingsListDVKField%>" /></th>
								                <th id="Th3" runat="server" class="ms-vh2-nofilter"></th>
							                </tr>
							                <tr ID="itemPlaceholder" runat="server">
							                </tr>
						                </table>
					                </td>
				                </tr>
				                <tr>
					                <td></td>
				                </tr>
			                </table>
		                </LayoutTemplate>
		                <EmptyDataTemplate>
			                <table>
				                <tr>
					                <td style="color:Red" class="ms-input"><asp:Label runat="server" ID="lblEmptyListText" Text="<%$Resources:DvkWeb,MapMetadata_lblEmptyListText%>" /> </td>
				                </tr>
			                </table>
		                </EmptyDataTemplate>
		                <ItemTemplate>
			                <tr class="ms-vb2">
				                <td class="ms-vb2"><asp:Label ID="lblSPFieldName" runat="server" Text='<%# Eval("SPFieldName") %>' /></td>
				                <td class="ms-vb2"><asp:Label ID="lblDvkElementName" runat="server" Text='<%# Eval("ElementName") %>' /></td>
				                <td class="ms-vb2"><asp:Button ID="btnDeleteMapping" runat="server" CssClass="ms-ButtonHeightWidth" Text="<%$Resources:DvkWeb,MapMetadata_btnDeleteMapping%>" ValidationGroup="deleteRecipientValidationGroup" CommandName="Delete" CommandArgument='<%# Eval("SPFieldName") + ";" + Eval("ElementName") + ";" + Eval("Namespace")%>' OnCommand="btnDeleteMapping_Command"  /></td>
			                </tr>
		                </ItemTemplate>
                            </asp:ListView>
                            <br /><br />
                            <asp:DropDownList ID="ddlSPFields" runat="server" CssClass="ms-input" ValidationGroup="AddMappingValidationGroup"
                                 DataTextField="Title" DataValueField="InternalName" />
                            <asp:DropDownList ID="ddlDvkFields" runat="server" CssClass="ms-input" 
                                ValidationGroup="AddMappingValidationGroup" DataTextField="Name" DataValueField="SelectionValue" />
                            <asp:Button ID="btnAddMapping" CssClass="ms-ButtonHeightWidth" runat="server" Text="<%$Resources:DvkWeb,MapMetadata_btnAddMapping%>" ValidationGroup="AddMappingValidationGroup" OnClick="btnAddMapping_Click" />
                			    
                            </Template_Control>
                            </wssuc:InputFormControl>

	</template_inputformcontrols>
        </wssuc:InputFormSection>
        <wssuc:ButtonSection SmallSectionLine="true" runat="server" ShowStandardCancelButton="true">
            <template_buttons>
				<asp:placeholder ID="Placeholder1" runat="server">
                    <asp:Button class="ms-ButtonHeightWidth" ID="btnSaveConfiguration" runat="server" Text="<%$Resources:DvkWeb,MapMetadata_btnSaveConfiguration%>" accesskey="<%$Resources:wss,okbutton_accesskey%>" OnClick="btnSaveConfiguration_Click"
                     ValidationGroup="SaveConfigurationValidationGroup" />		
				</asp:placeholder>
		</template_buttons>
        </wssuc:ButtonSection>
    </table>
    <Sharepoint:FormDigest ID="FormDigest1" runat="server" />
</asp:Content>
